
#ifndef __BILLBOARDGEOM_H__
#define __BILLBOARDGEOM_H__

#include "Geometry.h"

struct Billboard
{
	Billboard(const Real3 &p, float s)
	{ point = p; size = s; }

	Real3 point;
	float size;
};

class BillboardGeom : public Geometry
{
public:

	// Constructor
	BillboardGeom(Entity *_parent, bool _isFixedPoint = true);

	// Clears Data
	void Clear();

	// Creates a new billboard
	void AddBillboard(float size, const Real3 &point = Real3(0.0f, 0.0f, 0.0f));

private:

	// Static array of BillboardGeoms to rendered last
	static vector<BillboardGeom*> bbgeoms;
	static void RenderBBGeoms(uchar renderFlag);

	// List of Billboards
	vector<Billboard> billBoards;

	// Calculates Vertices based on Billboards
	void GenerateBillboards();

	// Renders the Billboards
	void _Render(uchar renderFlag);

	// Type of Billboard
	bool isFixedPoint;

	friend class Engine;
};

#endif // __BILLBOARDGEOM_H__